#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<math.h>
void main()
{float x,y;
int v,c;
float x1,y1,x2,y2,dy,dx,Steps,Xinc,Yinc;
int gdriver = DETECT,gmode;
initgraph(&gdriver,&gmode,"C:\\Turboc3\\BGI");
printf("enter your x1 and y1 and x2 and y2");
scanf("%f %f %f %f",&x1,&y1,&x2,&y2);
printf("enter choice \n 1.dashed \n 2.dotted");
scanf("%d",&c);
dx=x2-x1;
dy=y2-y1;
if(dx > dy)
 Steps = dx;
else
 Steps = dy;
Xinc = dx / Steps;
Yinc = dy / Steps;
for( v=0 ;v < Steps; v++)
{
 x = x + Xinc ;
 y = y + Yinc ;
if(v%9<5 && c==1)
{
putpixel(x,y,YELLOW);
}
if(v%2<1 && c==2)
{putpixel(x,y,YELLOW);
}
}
getch();
}